Developer --> Technical Publications
PATHHardware Documentation > USB Devices > Mac OS USB DDK API Reference


USBResetPipeByReference

The USBResetPipeByReference function resets the specified pipe or the device's default pipe 0.

OSStatus USBResetPipeByReference(USBReference ref);

--> ref
Pipe reference, or device reference for implicit default pipe 0.

In version 1.2 and later of the Mac OS USB software, all outstanding transactions on the pipe are returned with a kUSBAborted status. The pipe status is set to active. The stalled and idle state are cleared.

After this function is called, the device's endpoint needs to be synchronized with the host's endpoint. See Data Toggle Synchronization for information about how to accomplish endpoint data toggle synchronization.

IMPORTANT

For USB parameter block version 1.0, the implementation of USBResetPipeByReference does nothing if passed a real pipe reference. However, if the function is passed a non-existent pipe reference, it will corrupt low memory. Version 1.0.1 and later of the USB Services software corrects this problem.

Errors returned by the USBRestPipeByReference function include:

kUSBUnknownPipeErr
-6997 pipe reference specified is unknown

In version 1.0 of the USB Services software, the pipe may or may not have been made active, depending on whether the pipe was previously stalled or not, and the kUSBPipeIdleErr is returned. If an idle pipe was not stalled, it is not affected. If an idle pipe was stalled, it is made active. In version 1.0.1 and later of the USB Services software this behavior is corrected.

In version 1.0 of the USB Services software, the kUSBPipeStalledErr is returned if the pipe was previously idle and the call succeeded despite the error. This behavior is not an error and noErr is returned in versions 1.0.1 and later of the USB Services software.

kUSBPipeStalledErr
-6979 pipe stalled, pipe is reset despite the error

© 1999 Apple Computer, Inc.

Previous | Back Up One Level | Next | Show Frames | Hide Frames